package com.catmai.pssmanager.dao.impl;

import java.sql.SQLException;
import java.util.List;

import com.catmai.pssmanager.dao.PssFormDao;
import com.catmai.pssmanager.po.Pssform;

public class PssFormDaoImpl extends BasicDaoImpl<Pssform> implements PssFormDao{

	@Override
	public List<Pssform> findAll() throws SQLException {
		String sql = "select p.formId,p.goodsName,p.changeNumber,p.changeDay,p.storeArea,p.type from pssform p";
		return this.getList(connection, sql);
	}

	@Override
	public void saveObject(Pssform pssform) throws SQLException {
		String sql = "insert into pssform values(?,?,?,?,?,?)";
		Object [] args = {pssform.getFormId(),pssform.getGoodsName(),pssform.getChangeNumber(),pssform.getChangeDay(),pssform.getStoreArea(),pssform.getType()};
		this.update(connection, sql, args);
	}

	@Override
	public void deleteObject(String formId) throws SQLException {
		String sql = "delete from pssform where pssformId = ?";
		this.update(connection, sql, formId);
	}

	@Override
	public void updateObject(Pssform pssform) throws SQLException {
		
	}

}
